class SuperClass{
    private int num;
    public SuperClass(){

    }
    public SuperClass(int num){
        this.num=num;
    }
    public void setNum(int num){
        this.num=num;
    }
    public int getNum(){
        return this.num;
    }
}
interface FacInter{
    int fac();
}
interface SumInter{
    int sum();
}
class SubClass extends SuperClass implements FacInter,SumInter{
    public SubClass() {
    }

    public SubClass(int num) {
        super(num);
    }

    @Override
    public int fac() {
        int res=1;
        for(int i=1;i<=super.getNum();i++){
            res*=i;
        }
        return res;
    }

    @Override
    public int sum() {
        int res=0;
        for(int i=1;i<=super.getNum();i++){
            if(i%2==0){
                res+=i;
            }
        }
        return res;
    }
}
interface Animal{
    void eat(String food);
}
class Panda implements Animal{
    public static String type="大熊猫";
    private int age;
    public Panda(int age){
        this.age=age;
    }
    public void eat(String food){
        System.out.println(this.type+"正在吃"+food);
    }
    public String toString(){
        return this.age+"岁的"+this.type;
    }
}
class Giraffe implements Animal{
    public static String type="长颈鹿";
    private int age;
    public Giraffe(int age){
        this.age=age;
    }

    @Override
    public void eat(String food) {
        System.out.println(this.type+"正在吃"+food);
    }
    public String toString(){
        return this.age+"岁的"+this.type;
    }
}
class Feeder{
    private String name;
    private int age;

    public Feeder(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void feed(Animal animal, String food){
        System.out.println(this.age+"岁的饲养员"+this.name+"正在喂养"+animal.toString());
        animal.eat(food);
    }
}
interface Instrument{
    void play();
    void stopPlaying();
}
class Piano implements Instrument{
    public void play(){
        System.out.println();
    }
    public
}
public class Main {
    public static void main1(String[] args) {
        SubClass subClass1=new SubClass(5);
        SubClass subClass2=new SubClass(10);
        System.out.println(subClass1.fac());
        System.out.println(subClass2.sum());
    }

    public static void main(String[] args) {
        Feeder feeder=new Feeder("张三",32);
        Panda panda=new Panda(5);
        feeder.feed(panda,"竹子");
        Giraffe giraffe=new Giraffe(3);
        feeder.feed(giraffe,"树叶");
    }
}